<?php


namespace app\common\validate;


use think\Validate;

class Vld_station  extends Validate //验证 管理员规则
{
    //验证规则 station
    protected $rule=[
        'isalert|报警'=>'require',        
        'id|编号'=>'require|number',
    ];
    protected $message  =   [
        'state.isalert' => '报警状态不能为空！',
        'id.require'   => '编号不能为空！',
        'id.number'   => '编号为纯数字！',
    ];
    //验证场景

    protected  $scene=[
        //'add'=>['name','tel','tags','fst_id'],
        'edit'=>['id','isalert'],
    ];

    public function sceneDel()
    {   // del 验证方法
        return $this->only(['id']); //过滤不需要的unique规则;
    }
}
